import { reactive, ref } from "vue";

export default function InitHook() {
  const activeKey = ref<string>("0");
  const tableRef = ref<any>(null);
  const pageStat = ref<Base.GeneraDataType>({
    "0": 0,
    "1": 0,
    "2": 0,
    "3": 0
  });
  const searchForm = reactive<Partial<PlaceOrder.SearchForm>>({
    waybillNumList: "",
    bizIdList: [],
    addressTypeList: [],
    customerIdList: [],
    orderNoList: "",
    insuranceTypeList: [],
    insuranceCompanyIdList: [],
    pageNum: 1,
    pageSize: 100,
    total: 0
  });
  const tableData = ref<Array<PlaceOrder.ListRows>>([]);
  const dialogOpts = reactive<Base.DialogOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });
  const drawerOpts = reactive<Base.DrawerOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });
  return {
    searchForm,
    tableData,
    drawerOpts,
    activeKey,
    pageStat,
    tableRef,
    dialogOpts
  };
}
